<div id="main-bar" class="main-bar__container">
  <% if content_for?(:focus_mode) %>
    <div class="main-bar main-bar--focus-mode-back-button">
      <%= render partial: "layouts/decidim/header/focus_mode_back_button" if content_for(:focus_mode_return_path) %>
    </div>
  <% else %>
    <div class="main-bar">
      <div class="main-bar__logo">
        <div class="main-bar__logo-desktop">
          <%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
        </div>
        <div class="main-bar__logo-mobile">
          <%= render partial: "layouts/decidim/logo_mobile", locals: { organization: current_organization } %>
        </div>
      </div>
      <% if current_user&.ephemeral? %>
        <%= render partial: "layouts/decidim/header/close_ephemeral_session" %>
      <% else %>
        <div class="flex md:justify-between md:gap-x-10">
          <div role="search" class="main-bar__search">
            <%= render partial: "layouts/decidim/header/main_search" %>
          </div>
          <nav role="navigation" aria-label="<%= t("layouts.decidim.header.user_menu") %>" class="main-bar__links-desktop md:flex md:gap-x-8">
            <%= render partial: "layouts/decidim/header/main_links_desktop" %>
          </nav>
          <div class="main-bar__menu-mobile">
            <%= render partial: "layouts/decidim/header/main_menu_mobile" %>
          </div>
        </div>
        <%= render partial: "layouts/decidim/header/main_links_mobile_account" if current_user %>
      <% end %>
    </div>
  <% end %>
</div>
